#pragma once

#include "transform3d.h"
#include "Lighting.h"
#include <QObject>


class QOpenGLContext;
class Camera;


class MaterialProg : public QObject, public Transform3D
{
    Q_OBJECT

public:
    explicit MaterialProg(QObject *parent = nullptr);
    virtual ~MaterialProg();

    virtual void initializeGL(QOpenGLContext* ctx, void* arg, size_t argLen);
    virtual void paintGL(const Camera& camera, const QMatrix4x4& projection, const Light& light) = 0;

    const Material& material() const {return material_;}

signals:
    void dataChanged();

public slots:
    void setMaterial(const Material& material);

protected slots:
    virtual void teardownGL();

protected:
    QOpenGLContext* contex;    
    Material        material_;
};
